package valid

import "github.com/astaxie/beego/validation"

//菜单验证
func ValidAddMenu(menu map[string]interface{}) (bool, string) {
	valid := validation.Validation{}
	v := valid.Required(menu["title"], "title").Message("标题不能为空")
	if !v.Ok {
		return false, v.Error.Message
	}
	v = valid.Required(menu["pid"], "pid").Message("父栏目ID不能为空")
	if !v.Ok {
		return false, v.Error.Message
	}
	return true, ""
}

func ValidEditMenu(menu map[string]interface{}) (bool, string) {

	return true, ""
}
